<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
        TODO write content
        <input type="button" id="btn" onclick="f1()" value="Click">
        <input type="button" id="btn_remove" onclick="removeEvent()" value="Remove Event">
        <script type="text/javascript">
        var a = document.getElementById("a");
        //alert(a);
        function f1(){
            alert("f1");
        }
        function f2(){
            alert("f2");
        }
        function removeEvent(){
            var btn = document.getElementById("btn");
            //btn.onclick = null;
            btn.onclick = f2;  //传递函数引用
        }
    </script>

    </body>
</html>
